/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hera.process.config.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.hera.base.domain.BaseDomain;
import com.hera.process.security.domain.User;
import com.hera.process.workflow.domain.ProcessCategory;

/**
 *
 * @author cmontes
 */
@Entity
public class Calendar extends BaseDomain implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "Calendar")
    @TableGenerator(name = "Calendar", table = "sequence", pkColumnName = "seq_name", valueColumnName = "seq_id", pkColumnValue = "LoginMethod", allocationSize = 1)
    @Column(name = "ID_CALENDAR")
    private Long idCalendar;
    private String name;
    private String description;
    //@Column(name = "ID_STATUS")
    //private Long idStatus;
    @ManyToOne
    @JoinColumn(name="ID_STATUS")
    private ParameterDetail status;
	//@OneToMany(cascade = CascadeType.ALL, mappedBy = "calendar")
    @Transient
    private List<BusinessDay> businessDayList;
    @Transient
    //@OneToMany(mappedBy = "calendar")
    private List<Holiday> holidayList;
    //@OneToMany(mappedBy = "calendar")
    @Transient
    private List<User> sysUserList;

    public Calendar() {
    }

    public Calendar(Long idCalendar) {
        this.idCalendar = idCalendar;
    }

    public Long getIdCalendar() {
        return idCalendar;
    }

    public void setIdCalendar(Long idCalendar) {
        this.idCalendar = idCalendar;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<BusinessDay> getBusinessDayList() {
        return businessDayList;
    }

    public void setBusinessDayList(List<BusinessDay> businessDayList) {
        this.businessDayList = businessDayList;
    }

    public List<Holiday> getHolidayList() {
        return holidayList;
    }

    public void setHolidayList(List<Holiday> holidayList) {
        this.holidayList = holidayList;
    }

    public List<User> getSysUserList() {
        return sysUserList;
    }

    public void setSysUserList(List<User> sysUserList) {
        this.sysUserList = sysUserList;
    }
    
    public ParameterDetail getStatus() {
		return status;
	}

	public void setStatus(ParameterDetail status) {
		this.status = status;
	}

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCalendar != null ? idCalendar.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof Calendar)) {
            return false;
        }
        Calendar other = (Calendar) object;
        if ((this.idCalendar == null && other.idCalendar != null) || (this.idCalendar != null && !this.idCalendar.equals(other.idCalendar))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hera.process.data.domain2.Calendar[ idCalendar=" + idCalendar + " ]";
    }
    
}
